#ifndef _GUARD_LOGIC_
#define _GUARD_LOGIC_
#include "Card.h"
#include "Deck.h"
#include "Player.h"
#include "Table.h"
#include <iostream>
#include <set>
using namespace std;
class Logic
{
  public:
    bool doTick();
    Deck getActives();
    int getGameWinner(); /* -1 means no winner yet, -2 means everyone's dead. */
    vector<Player*> getMovingPlayers();
    set<Player*> getWarringPlayers();
    void processSoloMove();
    void removeSpoils();
    void setActive(Card*, Player*);
    void setTable(Table*);
    void taxPlayer(Player*, int numberOfCards);
    bool doBattle();
    void doWar();
    vector<Player*> evaluateTable();
    void giveBattleReward(Player* winner);
    Table* table;
    void checkConflict();
    Player* findConquerer();
    void freeVassals();
    void feedVassals();
    void findBattleWinner(int index, int iteration);
    void reviveVassals();
    void updateActiveCard();
    vector<Player*> handleAce(vector<Player*> result_vector);
    vector<Player*> getPlayersWithBestCard(Deck);
    vector<Player*> getTiePlayers();
    bool warringPlayersExist();
    
};
#endif
